import org.junit.Test;
import org.junit.Before;
import org.junit.After;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.core.IsNot.not;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Alert;
import org.openqa.selenium.Keys;
import java.util.*;
import java.net.MalformedURLException;
import java.net.URL;
public class PSYHomeAdminTest {
  private WebDriver driver;
  private Map<String, Object> vars;
  JavascriptExecutor js;
  @Before
  public void setUp() {
    driver = new ChromeDriver();
    js = (JavascriptExecutor) driver;
    vars = new HashMap<String, Object>();
  }
  @After
  public void tearDown() {
    driver.quit();
  }
  @Test
  public void pSYHomeAdminTrue01() {
    driver.get("https://sei-test.021hqit.com/group-5/group-5/");
    driver.findElement(By.cssSelector(".el-form-item:nth-child(1) .el-input__inner")).sendKeys("ecnu_admin");
    driver.findElement(By.cssSelector(".el-form-item:nth-child(2) .el-input__inner")).click();
    driver.findElement(By.cssSelector(".el-form-item:nth-child(2) .el-input__inner")).sendKeys("pl,okm123");
    driver.findElement(By.cssSelector(".el-button")).click();
    vars.put("message", driver.findElement(By.cssSelector(".el-message")).getText());
    assertEquals(vars.get("message").toString(), "登录成功");
    try {
      Thread.sleep(500);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    vars.put("today_consel_num", driver.findElement(By.cssSelector(".el-col:nth-child(1) > span:nth-child(2)")).getText());
    System.out.println("今日咨询数vars.get("today_consel_num").toString()");
    vars.put("today_consel_time", driver.findElement(By.cssSelector(".el-col-12:nth-child(2)")).getText());
    System.out.println("今日咨时长vars.get("today_consel_time").toString()");
    vars.put("today_consel_num_change", driver.getTitle());
    System.out.println("今日咨询数量变化vars.get("today_consel_num_change").toString()");
    vars.put("counseler_online", driver.findElement(By.cssSelector(".el-col-14")).getText());
    System.out.println("在线咨询师vars.get("counseler_online").toString()");
    vars.put("supervisor_num", driver.findElement(By.cssSelector(".m-l-20 > .leftCount")).getText());
    System.out.println("在线咨询师vars.get("counseler_online").toString()");
    vars.put("week_consel_stat", driver.getTitle());
    System.out.println("周咨询数变化vars.get("week_consel_stat").toString()");
    vars.put("month_rank1", driver.findElement(By.cssSelector(".consultingStatistics > div:nth-child(2)")).getText());
    System.out.println("月排1vars.get("month_rank1").toString()");
    vars.put("month_rank2", driver.findElement(By.cssSelector(".consultingStatistics > div:nth-child(3)")).getText());
    System.out.println("月排2vars.get("month_rank2").toString()");
  }
}
